import { axios } from '@/utils/request'

const api = {
  getSaasProtocol: '/saas/union-protocol',
  getWechatSetting: '/saas/wechat-setting',
  getPlatformWechatSetting: '/saas/wechat-platform-setting',
  getPlatformMchWechatSetting: '/saas/wechat-platform-mch-setting',
  getPlatformAlipaySetting: '/saas/alipay-platform-setting',
  getPlatformWechatThirdSetting: '/saas/wechat-third-setting',
  getPlatformByteDanceSetting: '/saas/bytedance-setting',
  getStoreShare: '/saas/store-share-setting',
  getAlipaySetting: '/saas/alipay-setting',
  smsSetting: '/saas/sms-setting',
  getBaseSetting: '/saas/get-base-setting',
  applyGet: '/saas/other-info',
  applySubmit: '/saas/submit-other-info',
  merchantList: '/saas/merchant-list',
  agency_config: '/saas/agency-config',
  ocrInfo: '/saas/ocr-setting',
  alipayThird: '/saas/ali-third-setting',
  creatAliKey: '/alipay-third/aes-auth',
  getCloudApplyInfo: '/saas/get-cloud-apply-info',
  submitCloudApplyInfo: '/saas/submit-cloud-apply-info',
  oneStoreWechatSetting: '/saas/one-store-wechat-setting',
  agencyPriceConfig: '/saas/agency-price-config',
  setAgencyPriceConfig: '/saas/agency-price-config',
  agencyConfig: '/saas/agency-config',
}

export default api

/**
 * 获取代理中心配置
 * @param parameter
 * @returns {AxiosPromise}
 */
export function getAgencyConfig(parameter) {
  return axios({
    url: api.agency_config,
    method: 'get',
    params: parameter,
  })
}
/**
 * 获取代理中心配置
 * @param parameter
 * @returns {AxiosPromise}
 */
export function setAgencyConfig(parameter) {
  return axios({
    url: api.agency_config,
    method: 'post',
    params: parameter,
  })
}
export function getBaseSetting(parameter) {
  return axios({
    url: api.getBaseSetting,
    method: 'get',
    params: parameter,
  })
}

export function getSaasProtocol(parameter) {
  return axios({
    url: api.getSaasProtocol,
    method: 'get',
    params: parameter,
  })
}

export function setSaasProtocol(parameter) {
  return axios({
    url: api.getSaasProtocol,
    method: 'post',
    data: parameter,
  })
}

export function getWechatSetting(parameter) {
  return axios({
    url: api.getWechatSetting,
    method: 'get',
    params: parameter,
  })
}

export function setWechatSetting(parameter) {
  return axios({
    url: api.getWechatSetting,
    method: 'post',
    data: parameter,
  })
}

export function getPlatformWechatSetting(parameter) {
  return axios({
    url: api.getPlatformWechatSetting,
    method: 'get',
    params: parameter,
  })
}

export function setPlatformWechatSetting(parameter) {
  return axios({
    url: api.getPlatformWechatSetting,
    method: 'post',
    data: parameter,
  })
}

export function getPlatformWechatMchSetting(parameter) {
  return axios({
    url: api.getPlatformMchWechatSetting,
    method: 'get',
    params: parameter,
  })
}

export function setPlatformWechatMchSetting(parameter) {
  return axios({
    url: api.getPlatformMchWechatSetting,
    method: 'post',
    data: parameter,
  })
}

export function getPlatformWechatThirdSetting(parameter) {
  return axios({
    url: api.getPlatformWechatThirdSetting,
    method: 'get',
    params: parameter,
  })
}
export function setPlatformWechatThirdSetting(parameter) {
  return axios({
    url: api.getPlatformWechatThirdSetting,
    method: 'post',
    data: parameter,
  })
}

export function getStoreShare(parameter) {
  return axios({
    url: api.getStoreShare,
    method: 'get',
    params: parameter,
  })
}

export function setStoreShare(parameter) {
  return axios({
    url: api.getStoreShare,
    method: 'post',
    data: parameter,
  })
}

export function getAlipaySetting(parameter) {
  return axios({
    url: api.getAlipaySetting,
    method: 'get',
    params: parameter,
  })
}

export function setAlipaySetting(parameter) {
  return axios({
    url: api.getAlipaySetting,
    method: 'post',
    data: parameter,
  })
}

export function setSmsSetting(parameter) {
  return axios({
    url: api.smsSetting,
    method: 'post',
    data: parameter,
  })
}

export function getSmsSetting(parameter) {
  return axios({
    url: api.smsSetting,
    method: 'get',
    params: parameter,
  })
}

export function getPlatformByteDanceSetting(parameter) {
  return axios({
    url: api.getPlatformByteDanceSetting,
    method: 'get',
    params: parameter,
  })
}

export function setPlatformByteDanceSetting(parameter) {
  return axios({
    url: api.getPlatformByteDanceSetting,
    method: 'post',
    data: parameter,
  })
}
export function applyGet(parameter) {
  return axios({
    url: api.applyGet,
    method: 'get',
    params: parameter,
  })
}

export function applySubmit(parameter) {
  return axios({
    url: api.applySubmit,
    method: 'post',
    data: parameter,
  })
}
export function merchantList(parameter) {
  return axios({
    url: api.merchantList,
    method: 'get',
    params: parameter,
  })
}

export function orcSub(parameter) {
  return axios({
    url: api.ocrInfo,
    method: 'post',
    data: parameter,
  })
}
export function ocrInfo(parameter) {
  return axios({
    url: api.ocrInfo,
    method: 'get',
    params: parameter,
  })
}

export function saveAlipayThird(parameter) {
  return axios({
    url: api.alipayThird,
    method: 'post',
    data: parameter,
  })
}
export function alipayThirdInfo(parameter) {
  return axios({
    url: api.alipayThird,
    method: 'get',
    params: parameter,
  })
}

export function creatAliKey(parameter) {
  return axios({
    url: api.creatAliKey,
    method: 'post',
    data: parameter,
  })
}

export function getPlatformAlipaySetting(parameter) {
  return axios({
    url: api.getPlatformAlipaySetting,
    method: 'get',
    params: parameter,
  })
}

export function setPlatformAlipaySetting(parameter) {
  return axios({
    url: api.getPlatformAlipaySetting,
    method: 'post',
    data: parameter,
  })
}

export function getCloudApplyInfo(parameter) {
  return axios({
    url: api.getCloudApplyInfo,
    method: 'get',
    params: parameter,
  })
}

export function submitCloudApplyInfo(parameter) {
  return axios({
    url: api.submitCloudApplyInfo,
    method: 'post',
    data: parameter,
  })
}

export function getOneStoreWechatSetting(parameter) {
  return axios({
    url: api.oneStoreWechatSetting,
    method: 'get',
    params: parameter,
  })
}

export function setOneStoreWechatSetting(parameter) {
  return axios({
    url: api.oneStoreWechatSetting,
    method: 'post',
    data: parameter,
  })
}

export function agencyPriceConfig() {
  return axios({
    url: api.agencyPriceConfig,
    method: 'get',
  })
}

export function setAgencyPriceConfig(data) {
  return axios({
    url: api.setAgencyPriceConfig,
    method: 'post',
    data,
  })
}

export function agencyConfig(data) {
  return axios({
    url: api.agencyConfig,
    method: 'post',
    data,
  })
}

export function storePriceAdd(data) {
  return axios({
    url: '/saas/store-price-add',
    method: 'post',
    data,
  })
}
export function storePriceDel(data) {
  return axios({
    url: '/saas/store-price-del',
    method: 'post',
    data,
  })
}

export function newGetSaasProtocol(params) {
  return axios({
    url: '/saas/saas-protocol',
    method: 'get',
    params,
  })
}

export function newSetSaasProtocol(data) {
  return axios({
    url: '/saas/saas-protocol',
    method: 'post',
    data,
  })
}
